/*
 * @Description:
 * @Author: mmzhang
 * @Date: 2022-11-14 10:12:04
 * @LastEditTime: 2023-01-10 16:05:04
 */
import dt from '@dt/dt'
import table from '@/components/dt/table/render.js'
import moment from 'moment'

function options(_this, process = false) {
  return [
    {
      type: 'index',
      title: '序号',
      width: 60
    },
    {
      field: 'operateDate',
      title: '操作时间',
      width: 180,
      slots: {
        default: (params, h) => {
          return params.row.operateDate ? moment(params.row.operateDate).format('YYYY-MM-DD HH:mm') : '-'
        }
      }
    },
    {
      field: 'auditPeople',
      title: '审批人',
      width: 180
    },
    {
      field: 'auditResult',
      title: '审批意见',
      width: 100
    },
    {
      field: 'auditReason',
      title: '审批内容',
      minWidth: 100
    },
    {
      title: '图片',
      minWidth: 130,
      visible: _this.isShowImg,
      cell: (item) => {
        return {
          btn: [
            {
              title:
                item.auditFile && item.auditFile != ''
                  ? `查看图片（${JSON.parse(item.auditFile).annexList.length}）`
                  : '',
              event: 'onImage'
            }
          ]
        }
      }
    },
    {
      title: '操作',
      width: 80,
      visible: _this.info.auditId && process ? true : false,
      cell: (item) => {
        return {
          btn: [
            {
              title: '转交',
              event: 'onRefer',
              code: '0206110000',
              visible: item.canRefer
            }
          ]
        }
      }
    }
  ]
}

export default {
  options
}
